<%@ page language="java" import="java.util.*" pageEncoding="UTF-8" %>
<%@ taglib prefix="s" uri="/struts-tags" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
    <jsp:include page="../common/header.jsp" />
    <script type="text/javascript">
        function searchBtn() {
            var $searchBtn = $("input[name=searchBtn]");
            $searchBtn.bind("click", function () {
                $.ajax(
                        {
                            type: "get",
                            url: "teacherSearchTest.action",
                            data: {
                                teacherBianHao: $("input[name=teacherBianHao]").val()
                            },
                            dataType: "json",
                            success: login_Result,
                            error: function () {
                                alert("系统异常，请稍后重试！");
                            }
                        }
                );
                function login_Result(data) {
                    var d = eval("(" + data + ")");
                    if (d.flag == 0) {
                        alert("没有此教师编号对应的教师信息，请重新核对后输入！");
                        window.location.href = "teacherSearch.action";
                        return;
                    }
                    else {
                        $("#myForm").submit();
                    }
                };
            });
        }

        $(function () {

            searchBtn();

        });
    </script>
    <jsp:include page="../common/mycss.jsp" />
</head>

<body>
<div class="lyear-layout-web">
    <div class="lyear-layout-container">
        <!--左侧导航-->
        <aside class="lyear-layout-sidebar">
            <!-- logo -->
            <div id="logo" class="sidebar-header">
                <jsp:include page="../common/title.jsp" />
            </div>
            <div class="lyear-layout-sidebar-scroll">
                <jsp:include page="../common/menu.jsp" />
            </div>
        </aside>
        <!--End 左侧导航-->
        <jsp:include page="../common/top.jsp" />
        <!--页面主要内容-->
        <main class="lyear-layout-content">
            <div class="container-fluid">
                <div class="row">
                    <div class="col-lg-12">
                        <div class="card">
                            <div class="card-toolbar clearfix">
                                <h5>教师管理&nbsp;&gt;&nbsp;教师信息查询</h5>
                            </div>
                            <div class="card-body">
                                <div id="accordion">

                                    <div align="center" class="frame">
                                        <form action="teacherSearchSuc.action" method="get" id="myForm">
                                            <strong>请输入完整的<span style="color:red">教师编号</span>：</strong><input type="text" name="teacherBianHao"
                                                                                                              value='<s:property value="teacherBianHao" />'/>&nbsp;&nbsp;&nbsp;<input
                                                type="button" name="searchBtn" value="查询"/>
                                        </form>
                                        <hr>
                                        <table cellspacing="0" cellpadding="8" class="datalist">
                                            <tr>
                                                <th>教师编号</th>
                                                <th>姓&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;名</th>
                                                <th>科&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;目</th>
                                                <th>性&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;别</th>
                                                <th>身份证号</th>
                                                <th>民&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;族</th>
                                                <th>政治面貌</th>
                                                <th>入职时间</th>

                                                <th>操作</th>
                                            </tr>
                                            <tr onmouseover="this.style.backgroundColor='#ffff66';" onmouseout="this.style.backgroundColor='#d4e3e5';">
                                                <td><s:property value="teacher.bianHao"/></td>
                                                <td><s:property value="teacher.name"/></td>
                                                <td><s:property value="teacher.courseName"/></td>
                                                <td><s:property value="teacher.sex"/></td>
                                                <td><s:property value="teacher.idCard"/></td>
                                                <td><s:property value="teacher.nation"/></td>
                                                <td><s:property value="teacher.polStat"/></td>
                                                <td><s:property value="teacher.jobTime"/></td>
                                                <td><a href="teacherModify.action?teacherBianHao=<s:property value="teacher.bianHao"/>"><input
                                                        type="button" value="修改"/></a>&nbsp;&nbsp;<a
                                                        href="teacherSeeing.action?teacherBianHao=<s:property value="teacher.bianHao"/>"><input
                                                        type="button" value="查看"/></a>&nbsp;&nbsp;<a
                                                        href='teacherDelete.action?bianHao=<s:property value="teacher.bianHao"/>'
                                                        onclick="return confirm('确定删除吗');"><input type="button" value="删除"/></a></td>
                                            </tr>
                                        </table>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>

                </div>

            </div>

        </main>
        <!--End 页面主要内容-->
    </div>
</div>
</body>
</html>
